home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Treccani Italiana Di Scienze Lettere Ed Arti
/
[Enciclopedia] Treccani Italiana di scienze lettere ed arti.iso
/
pc
/
data
/
xxi_appendice_dvd.swf
/
scripts
/
__Packages
/
mx
/
remoting
/
Service.as
< prev
Wrap
Text File
|
2007-11-08
|
2KB
|
82 lines
class mx.remoting.Service extends Object
{
static var version = "1.2.0.124";
var _allowRes = false;
function Service(gatewayURI, logger, serviceName, conn, resp)
{
super();
this.log = logger;
this.log.logInfo("Creating Service for " + serviceName,mx.services.Log.VERBOSE);
if(gatewayURI == "" && conn == null)
{
gatewayURI = mx.remoting.NetServices.gatewayUrl;
}
gatewayURI = mx.remoting.NetServices.getHttpUrl(gatewayURI);
if(conn == null)
{
conn = mx.remoting.NetServices.getConnection(gatewayURI);
if(conn == null)
{
this.log.logInfo("Creating gateway connection for " + gatewayURI,mx.services.Log.VERBOSE);
conn = mx.remoting.NetServices.createGatewayConnection(gatewayURI,logger);
}
}
this.__conn = conn;
conn.updateConfig();
this._allowRes = true;
this.__serviceName = serviceName;
this.__responder = resp;
this.log.logInfo("Successfully created Service",mx.services.Log.VERBOSE);
}
function get connection()
{
return this.__conn;
}
function __resolve(methodName)
{
if(this._allowRes)
{
var _loc2_ = this.__makeOpFunc(methodName);
this[methodName] = _loc2_;
return _loc2_;
}
return null;
}
function __makeOpFunc(name)
{
var op = new mx.remoting.Operation(name,this);
var _loc3_ = function()
{
op.invoke(arguments);
return op.send();
};
_loc3_.send = function()
{
return op.createThenSend();
};
_loc3_.setResponder = function(resp)
{
op.responder = resp;
};
_loc3_.getRequest = function()
{
return op.request;
};
_loc3_.setRequest = function(val)
{
op.request = val;
};
_loc3_.addProperty("request",_loc3_.getRequest,_loc3_.setRequest);
_loc3_.operation = op;
return _loc3_;
}
function get name()
{
return this.__serviceName;
}
function get responder()
{
return this.__responder;
}
}